import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SetMealFoodTypeVO, SetMealFoodTypeForm, SetMealFoodTypeQuery } from '@/api/kitchen/setMeal/foodType/types';

/**
 * 查询套餐里的菜品类型列表
 * @param query
 * @returns {*}
 */

export const listSetMealFoodType = (query?: SetMealFoodTypeQuery): AxiosPromise<SetMealFoodTypeVO[]> => {
  return request({
    url: '/kitchen/setMeal/foodType/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询套餐里的菜品类型详细
 * @param id
 */
export const getSetMealFoodType = (id: string | number): AxiosPromise<SetMealFoodTypeVO> => {
  return request({
    url: '/kitchen/setMeal/foodType/' + id,
    method: 'get'
  });
};

/**
 * 新增套餐里的菜品类型
 * @param data
 */
export const addSetMealFoodType = (data: SetMealFoodTypeForm) => {
  return request({
    url: '/kitchen/setMeal/foodType',
    method: 'post',
    data: data
  });
};

/**
 * 修改套餐里的菜品类型
 * @param data
 */
export const updateSetMealFoodType = (data: SetMealFoodTypeForm) => {
  return request({
    url: '/kitchen/setMeal/foodType',
    method: 'put',
    data: data
  });
};

/**
 * 删除套餐里的菜品类型
 * @param id
 */
export const delSetMealFoodType = (id: string | number | Array<string | number>) => {
  return request({
    url: '/kitchen/setMeal/foodType/' + id,
    method: 'delete'
  });
};
